package com.example.xgakj.mvp_demo.ui.activities;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import com.example.xgakj.mvp_demo.R;
import com.example.xgakj.mvp_demo.ui.contract.SplashContract;
import com.example.xgakj.mvp_demo.ui.presenter.SplashPresenter;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * An example full-screen activity that shows and hides the system UI (i.e.
 * status bar and navigation/system bar) with user interaction.
 */
public class SplashActivity extends AppCompatActivity implements SplashContract.View{
    @BindView(R.id.fullscreen_content)
    TextView fullscreenContent;
    SplashPresenter splashPresenter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        ButterKnife.bind(this);
        splashPresenter=new SplashPresenter(this);
        splashPresenter.attachView(this);
        splashPresenter.countDown(2);

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (splashPresenter!=null)
        splashPresenter.detachView();
    }

    @Override
    public Context getContext() {
        return this;
    }
}
